using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Practices.EnterpriseLibrary.Validation;

namespace EntLibContrib.Validation.Tests
{
    [TestClass]
    public class MultipleRuleSetValidatorFixture
    {
        [TestMethod, DeploymentItem("MultipleRuleSetValidator.config")]
        public void ValidationResultsFromMultipleRuleSetsAreAggregated()
        {
            MultipleRuleSetValidator validator = new MultipleRuleSetValidator("MultipleRuleSetValidator.config", new string[] { "RS1", "RS2" });
            List<ValidationResult> vrs = new List<ValidationResult>(validator.Validate(new ClassWithStringProperty()));

            Assert.AreEqual(2, vrs.Count);
        }
    }

    public class ClassWithStringProperty
    {
        public string StringProperty
        {
            get { return "foo"; }
        }
    }
}
